var jq=jQuery.noConflict();

function load() {
	initialiseDesign();
}

function initialiseDesign() {
	document.getElementById("header").style.width = window.getComputedStyle(document.getElementById("header"),null).width;
	var screenWidth = parseInt(document.getElementById("header").style.width) + 16;
	var logoWidth = document.getElementById("header_logo").offsetWidth;
	document.getElementById("header_logo").width = logoWidth - 60;
	var leftHeaderMenu = (screenWidth / 2.5);
	document.getElementById("headerMenu").style.left = leftHeaderMenu + "px";
	var leftHeaderMenuBack = (screenWidth / 2.65);
	document.getElementById("headermenu_back").style.left = leftHeaderMenuBack + "px";
	var leftSignout = (screenWidth / 1.3);
	document.getElementById("signout").style.left = leftSignout + "px";
	
	jq("#headerMenuHome label").hover(function(){
		jq("#headerMenuHome").css("background-color","rgba(255, 255, 255, .50)");
	},function(){
		jq("#headerMenuHome").css("background-color","transparent");
	});
	
	jq("#headerMenuProfile label").hover(function(){
		jq("#headerMenuProfile").css("background-color","rgba(255, 255, 255, .50)");
	},function(){
		jq("#headerMenuProfile").css("background-color","transparent");
	});
	
	jq("#headerMenuFriends label").hover(function(){
		jq("#headerMenuFriends").css("background-color","rgba(255, 255, 255, .50)");
	},function(){
		jq("#headerMenuFriends").css("background-color","transparent");
	});
	
	jq("#headerMenuInbox label").hover(function(){
		jq("#headerMenuInbox").css("background-color","rgba(255, 255, 255, .50)");
	},function(){
		jq("#headerMenuInbox").css("background-color","transparent");
	});
	
}

function setAjax(method, url, str) {
	var xmlhttp;
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else {// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if(method == "GET") {
		xmlhttp.open(method,url+"?"+str,true);
		xmlhttp.send();
	}
	else { // POST
		xmlhttp.open(method,url,true);
		xmlhttp.send(str);
	}
}

function getAjax(method, url, str)
{
	var xmlhttp;
	if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else {// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if(method == "GET") {
		xmlhttp.open(method,url+"?"+str,false);
		xmlhttp.send();
	}
	else { // POST
		xmlhttp.open(method,url,false);
		xmlhttp.send(str);
	}
	return xmlhttp.responseText;
}

